<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  class A{
    constructor(age,name){
      this.age= age;
      this.name=name;
    }
  }
  var b = new A(12,'linqinghu');

  // Object.keys(b).forEach((key)=>{
  //   console.log('key='+key+"----value="+b[key]);
  // })
  for(var key in b){
    console.log('key='+key+"----value="+b[key])
  }
</script>
</body>
</html>